
@(title: String)(content: Html)

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>@title</title>
            <!-- BEGIN GLOBAL MANDATORY STYLES -->
        @*<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />*@
        <link href="/main2/css/core/font-awesome.css" rel="stylesheet" type="text/css" />
        <link href="/main2/css/core/simple-line-icons.css" rel="stylesheet" type="text/css" />
        <link href="/main2/css/core/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="/main2/css/core/uniform.default.css" rel="stylesheet" type="text/css" />
        <link href="/main2/css/core/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
            <!-- END GLOBAL MANDATORY STYLES -->
            <!-- BEGIN PAGE LEVEL PLUGINS -->
            <!-- END PAGE LEVEL PLUGINS -->
            <!-- BEGIN THEME GLOBAL STYLES -->
        <link href="/main2/css/core/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
            <!-- END THEME GLOBAL STYLES -->
            <!-- BEGIN THEME LAYOUT STYLES -->
        <link href="/main2/css/core/layout.min.css" rel="stylesheet" type="text/css" />
        @*模板樣式*@
        <link href="/main2/css/core/darkblue.css" rel="stylesheet" type="text/css" id="style_color" />

            <!-- END THEME LAYOUT STYLES -->
        <link rel="shortcut icon" href="/main2/img/favicon.ico" />
            <!-- BEGIN CORE PLUGINS -->

        <script src="/main2/js/jstree/jquery-1.10.2.min.js" type="text/javascript"></script>
        <script src="/main2/js/core/bootstrap.min.js" type="text/javascript"></script>
            <!-- BEGIN THEME GLOBAL SCRIPTS 例如：左側菜單-->
        <script src="/main2/js/core/app.min.js" type="text/javascript"></script>
            <!-- BEGIN THEME LAYOUT SCRIPTS  例如：左側菜單-->
        <script src="/main2/js/core/layout.min.js" type="text/javascript"></script>

            <!-- END THEME LAYOUT SCRIPTS -->

    </head>
    @*<body>
    @content
    </body>*@
    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
            <!-- BEGIN HEADER -->
        <div class="page-header navbar navbar-fixed-top">
            <div class="page-header-inner ">
                <div class="page-logo">
                    <a href="main2.scala.html">
                        <img src="/main2/img/logo.png" alt="logo" class="logo-default" /> </a>
                    <div class="menu-toggler sidebar-toggler"> </div>
                </div>
                <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
                <div class="top-menu">
                    <ul class="nav navbar-nav pull-right">
                        <li class="dropdown dropdown-user">
                            <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                                <img alt="" class="img-circle" src="/main2/img/avatar3_small.jpg" />
                                <span class="username username-hide-on-mobile"> Nick </span>
                                <i class="fa fa-angle-down"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-default">
                                <li>
                                    <a href="">
                                        <i class="icon-lock"></i> Lock Screen </a>
                                </li>
                                <li>
                                    <a href="">
                                        <i class="icon-key"></i> Log Out </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="clearfix"> </div>
        <div class="page-container">
            <div class="page-sidebar-wrapper">
                <div class="page-sidebar navbar-collapse collapse">
                    <ul class="page-sidebar-menu  page-header-fixed " id="roleResourceUl" data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">
                        <li class="sidebar-toggler-wrapper hide">
                            <div class="sidebar-toggler"> </div>
                        </li>
                        <li class="sidebar-search-wrapper">
                            <form class="sidebar-search  " action="" method="POST">
                                <a href="javascript:;" class="remove">
                                    <i class="icon-close"></i>
                                </a>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="Search...">
                                    <span class="input-group-btn">
                                        <a href="javascript:;" class="btn submit">
                                            <i class="icon-magnifier"></i>
                                        </a>
                                    </span>
                                </div>
                            </form>
                        </li>
                        @*<li class="nav-item*@@* start active open*@@*" id="roleAndPermeissionManager">
                            <a href="javascript:;" class="nav-link nav-toggle">
                                <i class="icon-home"></i>*@@*图标*@@*
                                <span class="title">权限管理</span>
                                *@@*<span class="selected"></span>*@@* *@@*使被选中的导航有三角标志*@@*
                                <span class="arrow *@@*selected*@@*"></span>*@@*arrow 箭头  selected 默认选中*@@*
                            </a>
                            <ul class="sub-menu">
                                <li class="nav-item*@@* start active open*@@*" id="staffRole">
                                    <a href="" class="nav-link ">
                                        <i class="icon-bar-chart"></i>
                                        <span class="title">人员角色</span>
                                        *@@*<span class="selected"></span>*@@*
                                    </a>
                                </li>
                                <li class="nav-item  " id="permeissionManager">
                                    <a href="/roleAndPermisson/loadPerPage" class="nav-link ">
                                        <i class="icon-bulb"></i>
                                        <span class="title">授权管理</span>
                                        *@@* <span class="badge badge-success">1</span>*@@*
                                    </a>
                                </li>
                            </ul>
                        </li>


                        <li class="nav-item" id="pre_function">
                            <a href="javascript:;" class="nav-link nav-toggle">
                                <i class="icon-briefcase"></i>
                                <span class="title">前段功能</span>
                                <span class="arrow"></span>
                            </a>
                            <ul class="sub-menu">
                                <li class="nav-item" id="datepicker">
                                    <a href="javascript:;" class="nav-link nav-toggle">
                                        <i class="icon-bulb"></i>
                                        <span class="title">日历</span>
                                        <span class="arrow"></span>*@@*有子节点才可以有arrow*@@*
                                    </a>
                                    <ul class="sub-menu">
                                        <li class="nav-item " id="jqueryuiDatepicker">
                                            <a href="/jqueryui/datepicker" class="nav-link nav-toggle">
                                                <i class="icon-bulb"></i>
                                                <span class="title">jqueryui.datepicker</span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="nav-item" id="tree">
                                    <a href="javascript:;" class="nav-link nav-toggle">
                                        <i class="icon-bulb"></i>
                                        <span class="title">树的实例</span>
                                        <span class="arrow"></span>
                                    </a>
                                    <ul class="sub-menu">
                                        <li class="nav-item " id="tree-jstree">
                                            <a href="/mytree/jstree" class="nav-link ">
                                                <i class="icon-bulb"></i>
                                                <span class="title">jstree</span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="nav-item" id="formValidator">
                                    <a href="javascript:;" class="nav-link nav-toggle">
                                        <i class="icon-bulb"></i>
                                        <span class="title">表单校验</span>
                                        <span class="arrow"></span>
                                    </a>
                                    <ul class="sub-menu">
                                        <li class="nav-item " id="niceValidator">
                                            <a href="/pre_function/formValidator/niceValidator" class="nav-link ">
                                                <i class="icon-bulb"></i>
                                                <span class="title">niceValidator</span>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>*@
                    </ul>
                    <ul>

                    </ul>
                </div>
            </div>
            <div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <ul class="page-breadcrumb">
                            <li>
                                <i class="icon-home"></i>
                                <a href="/">Home</a>
                                <i class="fa fa-angle-right"></i>
                            </li>
                            <li>
                                <span>UI Features</span>
                            </li>
                        </ul>
                    </div>
                        <!-- END PAGE HEADER-->
                        <!-- BEGIN PAGE CONTENT-->
                    @content

                </div>
            </div>
            <a href="javascript:;" class="page-quick-sidebar-toggler">
                <i class="icon-login"></i>
            </a>
        </div>
        <div class="page-footer">
            <div class="page-footer-inner"> 2014 &copy; Metronic by keenthemes.
                <a href="http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes" title="Purchase Metronic just for 27$ and get lifetime updates for free" target="_blank">Purchase Metronic!</a>
            </div>
            <div class="scroll-to-top">
                <i class="icon-arrow-up"></i>
            </div>
        </div>

    </body>
    <script type="text/javascript">
         $(function () {
             var roleResourceUlHtml = $("#roleResourceUl").html();
             var appendRoleResourceUlHtml = "";
             $.get("/roleAndPermisson/changeListToTree2",function (data) {
                data=eval(data)
                if (data!=null && data !=''){
                    /*console.log(data)*/
                    for (var i=0 ;i<data.length;i++){
                        appendRoleResourceUlHtml+='<li class="nav-item" id="'+data[i].sign+'">'
                        appendRoleResourceUlHtml+='<a href="'+data[i].url+'" class="nav-link nav-toggle">'
                        appendRoleResourceUlHtml+='<i class="'+data[i].icon+'"></i>'
                        appendRoleResourceUlHtml+='<span class="title">'+data[i].text+'</span>'
                        var child = data[i].children
                        if (child!=null && child!=''){
                            appendRoleResourceUlHtml+='<span class="arrow"></span>'
                            appendRoleResourceUlHtml+='</a>'
                            addChildNode(child);
                        }else {
                            appendRoleResourceUlHtml+='</a>'
                        }
                        appendRoleResourceUlHtml+='</li>'
                    }
                    roleResourceUlHtml+=appendRoleResourceUlHtml
                    $("#roleResourceUl").html(roleResourceUlHtml);
                }
             })

             function addChildNode(child) {
                 appendRoleResourceUlHtml+='<ul class="sub-menu">'
                 for (var i =0;i<child.length;i++){
                     appendRoleResourceUlHtml+='<li class="nav-item" id="'+child[i].sign+'">'
                     appendRoleResourceUlHtml+='<a href="'+child[i].url+'" class="nav-link nav-toggle">'
                     appendRoleResourceUlHtml+='<i class="'+child[i].icon+'"></i>'
                     appendRoleResourceUlHtml+='<span class="title">'+child[i].text+'</span>'
                     var child2 = child[i].children
                     if (child2!=null && child2!=''){
                         appendRoleResourceUlHtml+='<span class="arrow"></span>'
                         appendRoleResourceUlHtml+='</a>'
                         addChildNode(child2);
                     }else {
                         appendRoleResourceUlHtml+='</a>'
                     }
                     appendRoleResourceUlHtml+='</li>'
                 }
                 appendRoleResourceUlHtml+='</ul>'
             }
         })

            function activeMenu(menuArray){
                $('.nav-item').removeClass('active');/*移除激活*/
                $('.nav-item').removeClass('open');/*移除展开*/
                $('.nav-item>a>span.arrow').removeClass('open');
                for (var i=0; i<menuArray.length;i++){
                    if (menuArray[i]!=null && menuArray[i]!=''){
                        var pLabelName =  menuArray[i].prop('tagName');
                        if('LI'==pLabelName){
                            menuArray[i].addClass("active");/**/
                            menuArray[i].addClass("open");
                            menuArray[i].children("a").children("span.arrow").addClass("open");
                            if (i==0){
                                menuArray[i].children("a").children("span.arrow").addClass("selected");
                                menuArray[i].children("a").children("span").removeClass("arrow");
                            }
                        }
                    }

                }
            }
    </script>
</html>
